<div class="modal-dialog">
    <div class="modal-content">
        <form role="form" action="{:U('industry/edit')}" method="post" id="addForm" enctype="multipart/form-data">
            <input type="hidden" name="id" value="{$result.id}"/>
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                <h4 class="modal-title">编辑行业</h4>
            </div>
            <div class="modal-body">

                <div class="form-group">
                    <label for="name">行业名称</label>
                    <input type="text" class="form-control" id="name" name="name" value="{$result.name}">
                </div>

                <div class="form-group">
                    <label for="sort">排序</label>
                    <input type="text" name="sort" class="form-control" value="{$result.sort}"/>
                </div>
                <div class="form-group">
                    <label for="icon">图标</label>
                    <input type="file" name="icon" class="form-control"/>
                    <img src="{$result.icon}" style="max-width: 150px; "/>
                </div>
            </div>
            <div class="modal-footer">
                <button type="submit" class="btn btn-danger">确认保存</button>
            </div>
        </form>
    </div>
    <script type="text/javascript">
        $("#addForm").bootstrapValidator({
            excluded: [':disabled'],
            feedbackIcons: {
                valid: 'glyphicon glyphicon-ok',
                invalid: 'glyphicon glyphicon-remove',
                validating: 'glyphicon glyphicon-refresh'
            },
            submitHandler: function (validator, form, submitButton) {
                validator.defaultSubmit();
            },
            fields: {
                name: {
                    validators: {
                        notEmpty: {
                            message: '名称不能为空'
                        }
                    }
                }
            }
        });

    </script>
</div>